module utils 
{
	/**
	 *
	 * @author 
	 *
	 */
	export class CoreData 
	{
        private static _instance: utils.CoreData;
        public stageScale: number;
		public stage: egret.Stage;
        public stageW:number;
        public stageH:number;
        //openid
        public shareId:string;
        public keyid:number;
        public imgsArr;
        public openid:string;
        public sharePlayerName:string;
        public tileWidth:number;
        public tileHeight:number;
        //方块之间的间隔
        public tileDis:number=1;
        public photoPath:string;
        // 方块的摆放位置 第一个位置11代表 编号为11的方块放在了第一个位置
        public confuseArr=[0,1,2,3,4,5,6,7,8];
        // 方块横竖的数量
        public rowNum = 3;
        public colNum = 3;
        public photo: egret.Bitmap;
        public myRank:number;
        public myBestScore:number;
        public rankData;
        //在手机中需要全屏幕显示的宽高 
		// *** 因为显示到手机屏幕上需要乘以缩放值
		public screenW: number;
		public screenH: number;
    	
        //openid
		public userid: string;

        //
		public total_source:number = 0;
        public cur_source:number = 0;
        public cur_Dtsource:number = 0;
        public rb_width:number = 150;

        // this.boat_arr.push({'index':1,names:'西安号'});
		// this.boat_arr.push({'index':2,names:'石家庄号'});
		// this.boat_arr.push({'index':3,names:'昆明号'});
		// this.boat_arr.push({'index':4,names:'淮北号'});
		// this.boat_arr.push({'index':5,names:'徐州号'});
		// this.boat_arr.push({'index':6,names:'长征一号'});
		// this.boat_arr.push({'index':7,names:'辽宁号'});

        public cur_boat_id = 1;
        public cur_select_boat_id = 1;
        public boat_img_arr:Array<number> = [4,1,2,2,3,3,5];
        public load_arr:Array<number> = [0,0,0,0,0,0,0];
        //是否加载展示页
        public is_load_view:boolean = false;
        public rand_img_arr:Object = {1:7,2:7,3:5,4:15};
		
        public StageY:number = 0;
        public StageX:number = 0;
        

        public constructor() 
		{
    		
		}
		
        public static getInstance():utils.CoreData
		{
            if(!utils.CoreData._instance)
            {
                this._instance = new utils.CoreData();
            }
            return this._instance;
		}

        public static get instance():utils.CoreData
		{
            if(!utils.CoreData._instance)
            {
                this._instance = new utils.CoreData();
            }
            return this._instance;
		}

         public get_rand_img(){
            //img_arr
            var big_types:number = Math.ceil(Math.random()*4);
            var sm_types:number = Math.ceil(Math.random()*this.rand_img_arr[big_types]);
            return [big_types,sm_types]
        }



	}
}
